<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>/js/init.js"></script>
<div class="ev-formulario">
    <h3>Nova tarefa</h3>
    <form action="<?php echo $this->baseUrl() ?>/tarefa/tarefa/adicionar" method="post" name="formulario" id="formulario">
        <input type="hidden" name="fk_cliente" id="fk_cliente" value="<?php echo $this->fk_cliente; ?>" />
<?php if ($this->fk_projeto): ?>
        <input type="hidden" name="fk_projeto" id="fk_projeto" value="<?php echo $this->fk_projeto; ?>" />

        <div class="campo">
            <label for="fk_projeto"><?php echo $this->translate('fk_projeto'); ?>&nbsp; : </label>
            <strong><?php echo $this->projetoNome; ?></strong>
        </div>
<?php endif; ?>

<?php if ($this->fk_servico): ?>
        <div class="campo">
            <input type="hidden" name="fk_servico" id="fk_servico" value="<?php echo $this->fk_servico; ?>" />
            <label for="fk_servico"><?php echo $this->translate('fk_servico'); ?>&nbsp; : </label>
            <?php echo $this->rowTipoServico->st_nome; ?>
        </div>
<?php endif; ?>

        <div class="ev-campo">
            <label for="bo_previsao"><?php echo $this->translate( "bo_previsao"); ?></label>
            <?php echo $this->formRadio('bo_previsao', 'N', array('class' => 'text ui-widget-content ui-corner-all'), $this->aPrevisao, "\n &nbsp;&nbsp;"); ?>
        </div>


        <div class="campo">
            <label for="st_nome"><?php echo $this->translate('st_nome'); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
            <input class="text ui-widget-content ui-corner-all required" type="text" name="st_nome" id="st_nome" title="<?php echo $this->translate("st_nome"); ?>"  maxlength="150" />
        </div>

        <div class="campo">
            <label for="dt_inicio"><?php echo $this->translate('dt_inicio'); ?>: </label>
            <input class="text ui-widget-content ui-corner-all data" type="text" name="dt_previsao_inicio" id="dt_previsao_inicio" title="<?php echo $this->translate("dt_inicio"); ?>"  maxlength="45" />
        </div>

        <div class="campo">
            <label for="dt_fim"><?php echo $this->translate('dt_fim'); ?>:</label>
            <input class="text ui-widget-content ui-corner-all data" type="text" name="dt_previsao_fim" id="dt_previsao_fim" title="<?php echo $this->translate("dt_fim"); ?>"   />
        </div>
   		<div class="campo">
	        <label for="fk_usuario">Responsável:</label>
	        <?php echo $this->formSelect('fk_usuario_responsavel', $this->idUsuarioLogado, array('required' => 'required', 'class' => 'required'), $this->aUsuarios); ?>
	    </div>
   		<div class="campo">
	        <label for="fk_processo">Fase da tarefa:</label>
	         <?php echo $this->formSelect('fk_processo', $this->fk_processo, array('required' => 'required', 'class' => 'required'), $this->fk_processo); ?>
	    </div>
        
        <label for="st_descricao"><?php echo $this->translate('st_descricao'); ?>: </label>
        <textarea rows="7" cols="30" name="st_descricao" id="st_descricao" title="<?php echo $this->translate("st_descricao"); ?>"></textarea>

        <label for="fk_usuario">Responsável:</label>
        <?php echo $this->formSelect('fk_usuario_responsavel', $this->idUsuarioLogado, array('required' => 'required', 'class' => 'required'), $this->aUsuarios); ?>

		<div class="campo">
	        <label for="fk_usuario">Encaminhar:</label>
	        <?php echo $this->formSelect('fk_usuario', $this->idUsuarioLogado, array('required' => 'required', 'class' => 'required'), $this->aUsuarios); ?>
	     </div>
    </form>
</div>

<script type="text/javascript">
    $(function(){
        $("form").validate({ignoreTitle: true});
        $('#st_nome').change(function(){
            if($(this).val()){
                $('#st_descricao').val($(this).val());                
            }
        });
    });
</script>